package com.amxing.spider.task.support;

import com.amxing.spider.task.Task;
import com.amxing.spider.task.TaskCache;

/**
 * @auther amxing
 * @desc
 * @createTime 2018/8/14 21:22
 */
public abstract class BatchTask implements Task {

    private TaskCache taskCache;

    public BatchTask(TaskCache taskCache) {
        this.taskCache = taskCache;
    }

    public TaskCache getTaskCache() {
        if (taskCache == null)
            taskCache = new TaskCache(getUUID());
        return taskCache;
    }

    public void setTaskCache(TaskCache taskCache) {
        this.taskCache = taskCache;
    }

}
